<template>
  <!-- 跟单发起人页面 -->
  <view>
    <view class="gendan-top">
      <!-- 用户信息部分 -->
      <view class="userinfo">
        <view class="userinfo-img">
          <image src="../../static/active-home.png" mode=""></image>
        </view>
        <view class="">
          <view class="user-phone">
            18462245645
          </view>
          <u-icon color="#FFFFFF" name="edit-pen" @click="show = true"></u-icon>
        </view>
      </view>
      <view class="gendan-cen">
        <view class="gendan-center">
          <view class="gendaninfo one">
            <view class="">
              累计跟单投入(BTC)
            </view>
            <text class="count">0</text>
            <view class="renshu">
              累计跟单人数
            </view>
            <text class="count">0</text>
          </view>
          <view class="gendaninfo two">
            <view class="">
              累计跟单收益(BTC)
            </view>
            <text>0</text>
            <view class="renshu">
              <view class="">
                <text>默认佣金</text>
                <u-icon color="#196bd9" name="edit-pen" @click="moneyshow = true"></u-icon>
              </view>
              <view class="count vtn">
                2 VTN
              </view>
              <view class="count">
                (含体现权益)
              </view>
            </view>
          </view>
          <view class="gendaninfo three">
            <view class="dangqian">
              <view class="">
                当前跟单人数
              </view>
              <text class="count">0</text>
            </view>
          </view>
        </view>
        <view class="leiji">
          <text>累计佣金收入</text>
          <text class="count">0.00VTN</text>
        </view>
      </view>
    </view>
    <view class="gendan-bottom">
      <view>
        <u-tabs-swiper ref="uTabs" :list="list" :current="current" @change="tabsChange" active-color="#FFFFFF"
          :is-scroll="false" bg-color="#0a1332" inactive-color="#757ea2" swiperWidth="750"></u-tabs-swiper>
      </view>
      <swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
        <swiper-item class="swiper-item">
          <scroll-view scroll-y style="height: 800rpx;width: 100%;" @scrolltolower="onreachBottom">
            <view class="lianghua-list heyue-list">
              <text class="heyue-title">合约</text>
              <view class="heyue-con">
                <view class="">
                  <text class="mading-title">合约马丁</text>
                  <text class="heyue-v">okex</text>
                </view>
                <view class="heyue-baifenbi">
                  <text class="heyue-baifen">+46545656%</text>
                  <view class="">
                    年化收益率
                  </view>
                </view>
              </view>
                 </view>
          </scroll-view>
        </swiper-item>
        <swiper-item class="swiper-item">
          <scroll-view scroll-y style="height: 800rpx;width: 100%;" @scrolltolower="onreachBottom">
            ...
          </scroll-view>
        </swiper-item>
      </swiper>
    </view>
    <!-- 签名弹出层 -->
    	<u-popup v-model="show" mode="center" mask :mask-close-able="maskcloseable" :closeable="closeable" >
    			<view class="content">
    			  <view class="qianming">签名</view>
    			  <view class="qianming-con">
    			    <input type="text" value="" placeholder="请输入签名1-10个字" />
    			  </view>
    			  <view class="btns-qianming">
    			    <button type="default" size="mini">取消</button>
    			    <button type="default" size="mini">确认</button>
    			  </view>
    			</view>
    		</u-popup>
            <!-- 签名弹出层 -->
        <!-- 修改默认佣金 -->
        <u-popup v-model="moneyshow" mode="center" mask :mask-close-able="maskcloseable" :closeable="closeable">
         			<view class="money-box">
                <view class="money-title">修改默认佣金</view>
                <view class="meiri">
                  <text>每日佣金</text>
                  <view class="yongjin-input">
                    <input type="text" value="" />
                    <text>VTN</text>
                  </view>
                </view>
             <view class="xiaoyi">
               <text>是否包含体现效益</text>
               <u-switch v-model="checked" size="45"></u-switch>
             </view>
             <view class="yongjin-text">
               *默认值修改仅对新发跟单策略，原有策略不受影响
             </view>
             <view class="money-btns">
               <button type="default" size="mini">取消</button>
               <button type="primary" size="mini">确认</button>
             </view>
              </view>
         		</u-popup>
         <!-- 修改默认佣金 -->
  </view>


</template>

<script>
  export default {
    data() {
      return {
        checked:true, // 是否包含体现权益开关
        moneyshow:false, // 修改默认佣金弹出层
        closeable:true, // 是否显示关闭按钮
        maskcloseable:false, // 点击遮罩层是否关闭弹出层
        show: false,
        list: [{
          name: '当前策略'
        }, {
          name: '历史策略'
        }],
        // 因为内部的滑动机制限制，请将tabs组件和swiper组件的current用不同变量赋值
        current: 0, // tabs组件的current值，表示当前活动的tab选项
        swiperCurrent: 0, // swiper组件的current值，表示当前那个swiper-item是活动的
      }
    },
    methods: {
      // tabs通知swiper切换
      tabsChange(index) {
        this.swiperCurrent = index;
      },
      // swiper-item左右移动，通知tabs的滑块跟随移动
      transition(e) {
        let dx = e.detail.dx;
        this.$refs.uTabs.setDx(dx);
      },
      // 由于swiper的内部机制问题，快速切换swiper不会触发dx的连续变化，需要在结束时重置状态
      // swiper滑动结束，分别设置tabs和swiper的状态
      animationfinish(e) {
        let current = e.detail.current;
        this.$refs.uTabs.setFinishCurrent(current);
        this.swiperCurrent = current;
        this.current = current;
      },
      // scroll-view到底部加载更多
      onreachBottom() {

      }
    }
  }
</script>

<style>
  page {
    background-color: #0a1332;
  }

  .gendan-top {
    /* position: relative; */
    background: -webkit-linear-gradient(top, #2374fd, #445ffe, #6b4bf8, #7140fb);
    height: 400rpx;
  }

  .userinfo {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 250rpx;
    margin-left: 60rpx;
  }

  .user-phone {
    font-size: 34rpx;
    color: #FFFFFF;
    margin-bottom: 10rpx;
  }

  .userinfo-img image {
    width: 90rpx;
    height: 90rpx;
    margin-right: 40rpx;
  }

  .gendan-cen {
    height: 400rpx;
    z-index: 2;
    margin: 0 20rpx;
    color: #a9b4d4;
    border-radius: 10rpx;
    background-color: #131e3e;
  }

  .gendan-center {
    height: 340rpx;
    display: flex;
    padding: 30rpx;
    font-size: 24rpx;
  }

  .leiji {
    display: flex;
    justify-content: space-between;
    height: 60rpx;
    line-height: 60rpx;
    background-color: #1e2c47;
    padding: 0 60rpx;
    font-size: 24rpx;
  }

  .gendan-bottom {
    margin-top: 300rpx;
  }

  .renshu {
    margin-top: 40rpx;
  }

  .count {
    color: #FFFFFF;
  }

  .one {
    width: 38%;
  }

  .two {
    width: 38%;
  }

  .three {
    width: 24%;
  }

  .dangqian {
    text-align: right;
  }

  .vtn {
    margin: 8rpx 0;
  }
  .content{
    width: 600rpx;
    height: 340rpx;
    padding: 30rpx;
    background-color: #232c2e;
  }
  .qianming{
    color: #FFFFFF;
    font-size: 36rpx;
    text-align: center;
  }
  .qianming-con{
    border-bottom: 1rpx solid #294670;
    margin: 50rpx 0;
  }
  .qianming-con input{
    color: #bbbfd3;
  }
  .btns-qianming{
    display: flex;
    justify-content: space-around;
  }
  .btns-qianming button{
    color: #2183f7;
    background-color: #232c2e;
    border: 0 solid #232c2e;
  }
  .money-box{
    width: 660rpx;
    height: 550rpx;
    color: #b1bfda;
    background-color: #1e2c47;
    padding:0 40rpx 40rpx;
  }
  .money-title{
    height: 120rpx;
    line-height: 120rpx;
    font-size: 36rpx;
    color: #FFFFFF;
    text-align: center;
  }
  .meiri{
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .yongjin-input{
    display: flex;
    align-items: center;
    height: 80rpx;
    background-color: #0a1330;
    border-radius: 40rpx;
    padding: 0 30rpx;
  }
  .yongjin-input input{
    width: 220rpx;
    border-right: 1rpx solid #48516e;
    margin-right: 20rpx;
  }
  .xiaoyi{
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 140rpx;
  }
  .yongjin-text{
    font-size: 16rpx;
    margin-bottom: 30rpx;
  }
  .money-btns{
    display: flex;
    justify-content: space-around;
  }
  .lianghua-list {
    position: relative;
    height: 200rpx;
    background-color: #131c3d;
    border-radius: 20rpx;
    margin: 20rpx;
    color: #7381a0;
    padding: 0 40rpx;
  }
  .heyue-list {
    padding: 0;
    border-radius: 10rpx;
  }
  .heyue-title {
    position: absolute;
    top: 0;
    right: 0;
    color: red;
    font-size: 24rpx;
    padding: 4rpx;
    background-color: #1a3d71;
    border-radius: 10rpx;
  }
  .heyue-con {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 200rpx;
    padding: 40rpx;
  }
  
  .mading-title {
    color: #FFFFFF;
    font-size: 34rpx;
    margin-right: 16rpx;
  }
  .heyue-v {
    font-size: 24rpx;
    padding: 2rpx 14rpx;
    border: 1px solid #1b2645;
    border-radius: 20rpx;
    color: #FFFFFF;
  }
  .heyue-baifenbi {
    text-align: end;
  }
 .heyue-baifen {
   font-size: 36rpx;
   color: #ff0000;
   margin-bottom: 10rpx;
 }
</style>
